package com.chinasi.dao.impl;

import java.util.List;

import org.apache.ibatis.session.RowBounds;

import com.chinasi.dao.BidAgencyDao;
import com.chinasi.model.AgencyBasic;
import com.chinasi.model.BidAgency;
import com.chinasi.model.BidConsumer;
import com.chinasi.model.ConsumerBasic;
import com.chinasi.model.mvo.BidAgencyMvo;
import com.chinasi.model.mvo.BidConsultMvo;
import com.chinasi.model.mvo.BidConsumerMvo;
import com.chinasi.model.mvo.BidExpertMvo;
import com.chinasi.model.mvo.BidIntegrationMvo;
import com.chinasi.model.mvo.BidSupvisionMvo;
import com.caland.framework.core.annotation.Dao;
import com.caland.framework.core.page.Pager;
import com.caland.framework.dao.ibatis.impl.MyBatisBaseDaoImpl;

@Dao
public class BidAgencyDaoImpl extends MyBatisBaseDaoImpl<BidAgency, java.lang.String> implements BidAgencyDao {

	private static final String SQL_PREFIX = "com.chinasi.model.BidAgency.";
	@Override
	public List<BidAgencyMvo> findRelationBid(BidAgency searchBean,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationBid", searchBean, rowBounds);
	}
	@Override
	public int getRelationConsultTotalCount(AgencyBasic agency) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsultTotalCount", agency);
	}
	@Override
	public List<BidConsultMvo> findRelationConsult(AgencyBasic agency,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsult", agency, rowBounds);
	}
	@Override
	public int getRelationIntegratorTotalCount(AgencyBasic agency) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationIntegratorTotalCount", agency);
	}
	@Override
	public List<BidIntegrationMvo> findRelationIntegrator(
			AgencyBasic agency, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationIntegrator", agency, rowBounds);
	}
	@Override
	public int getRelationConsumerTotalCount(AgencyBasic agency) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsumerTotalCount", agency);
	}
	@Override
	public List<BidConsumerMvo> findRelationConsumer(AgencyBasic agency,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsumer", agency, rowBounds);
	}
	@Override
	public int getRelationSupervisionTotalCount(AgencyBasic agency) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationSupervisionTotalCount", agency);
	}
	@Override
	public List<BidSupvisionMvo> findRelationSupervision(
			AgencyBasic agency, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationSupervision", agency, rowBounds);
	}
	@Override
	public int getRelationExpertTotalCount(AgencyBasic agency) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationExpertTotalCount", agency);
	}
	@Override
	public List<BidExpertMvo> findRelationExpert(AgencyBasic agency,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationExpert", agency, rowBounds);
	}
}
